//验证手机号码是否符合规则
function isPhone(value) {
	var reg = /^1[0-9]{10}$/;
	if (!reg.test(value)) {
		return false;
	} else {
		return true;
	}
}

//获取cookie
function getCookie(sname){
	var acookie = document.cookie.split("; ");
	for (var i = 0; i < acookie.length; i++) {
		var arr = acookie[i].split("=");
		if (sname === arr[0]) {
			if (arr.length > 1)
				return unescape(arr[1]);
			else
				return "";
		}
	}
	return "";
}
//设置cookie
function setCookie(name,value,option){
	var seconds = option&&option.time?option.time*24*60*60 : 0;
	var expires = "";
	if (seconds !== 0 ) {      //设置cookie生存时间
		var date = new Date();
		date.setTime(date.getTime()+(seconds*1000));
		expires = "; expires="+date.toGMTString();
	}
	var path = option.path||'/';
	document.cookie = name+"="+escape(value)+expires+"; path="+path;
}
//删除cookie
function delCookie(name) {
	setCookie(name,'',{time:-1});
}